<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 */

get_header(); ?>

		<div id="primary">
			<div id="content" role="main" class="homepage_content">
			<?php if ( have_posts() ) : ?>
            
            	<div class="slider_wrap">
                    <ul class="slider clearfix" id="HomepageSlider">
                    	<?php 
                        $args = array('category_name' => 'homepage-slider');
                        $the_query = new WP_Query( $args );
                        
                        while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                            <li class="slide">
                                <div class="slide_image">
                                    <?php the_content(); ?>
                                </div>
                                <!--
                                <div class="slide_content">
                                    <div class="slide_title"><?php the_title(); ?></div>
                                    <div class="slide_excerpt"><?php the_excerpt(); ?></div>
                                </div>-->
                            </li>
                        <?php endwhile; ?>
                    </ul>
                    <div class="slider_nav_wrap slider_nav_prev">
                    	<a href="#prev" id="SliderPrev" title="Previous Slide"><span>Previous Slide</span></a>
                    </div>
                    <div class="slider_nav_wrap slider_nav_next">
                    	<a href="#next" id="SliderNext" title="Next Slide"><span>Next Slide</span></a>
                    </div>
                </div><!-- .slider_wrap -->
                
                <div class="homepage_mods_wrap">
                	<div class="homepage_mods clearfix">
                    	<?php 
                        $args = array('category_name' => 'homepage-callout','posts_per_page=4');
                        $the_query = new WP_Query( $args );
                        
                        while ( $the_query->have_posts() ) : $the_query->the_post();
							$title = get_post_meta($post->ID,'Title',true);
							$icon = get_post_meta($post->ID,'Image',true);
							$link = get_post_meta($post->ID,'URL',true);
						?>
                            <div class="mod">
                                <div class="mod_pad">
                                    <div class="mod_title"><?php echo('<a href="'.$root.$link.'">'.$title.'</a>'); ?></div>
                                    <div class="mod_content">
                                        <div class="mod_text">
                                        	<div class="mod_icon"><?php echo('<a href="'.$root.$link.'"><img src="'.$icon.'" alt="'.$title.'" /></a>'); ?></div>
                                            <?php the_content(); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endwhile; ?>
                    </div>
                </div>
			<?php endif; 
				wp_reset_query();
			?>
            
			</div><!-- #content -->
		</div><!-- #primary -->
<?php get_footer(); ?>